home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 625 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.1 KB

  1. Path: nntp.teleport.com!sschaem
  2. From: sschaem@teleport.com (Stephan Schaem)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: PPC compilers
  5. Date: 9 Jan 1996 20:04:00 GMT
  6. Organization: Teleport - Portland's Public Access (503) 220-1016
  7. Message-ID: <4cuhng$dmn@maureen.teleport.com>
  8. References: <john.hendrikx.40ka@grafix.xs4all.nl> <MQAQx*XOe@yaps.rhein.de> <OWhVx*42f@yaps.rhein.de>
  9. NNTP-Posting-Host: kelly.teleport.com
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Arno Eigenwillig (arno@yaps.rhein.de) wrote:
  13. : In article <4cokkg$415@maureen.teleport.com>, Stephan Schaem writes:
  14.  
  15. : >  So you do math operation without knowing that your destination need to 
  16. : >  be a float or a 2 byte int? 
  17.  
  18. : Why don't you read what he wrote? A reasonable example for that would
  19. : be operations on clock_t.
  20.  
  21.  The claim was general: you can forget your variable type when you use 
  22.  them in C... I'm just saying thats its not wise.
  23.  
  24. : >  So you created a structure to hold clock value with ulong? now recompile
  25. : >  this on the system using a clock size of 64bit... where did the upper
  26. : >  32bit goes... you know have code that is broken.
  27.  
  28. : Why don't you read what he wrote? You use clock_t and treat it as a
  29. : 'black box'. As you never name the underlying type, you are fully
  30. : portable.
  31.  
  32.  What if clock_t is on other system a pointer to a bcpl string?
  33.  
  34. : >  It could be done in a macro assembler by 'tydefing' instruction size.
  35.  
  36. : Name an existing assembler that allows such things.
  37.  
  38.  You can write yourself a simple preprocessor that will do a search replace
  39.  using a mytype.typedef file... The point I wanted to make is this:
  40.  
  41.  [Store    variable of type A, into variable of type A]
  42.  
  43.  This is what I think when I write
  44.  
  45.  chipreg->bltcon0 = con0;
  46.  
  47.  [Store con0 of type CHIPREG, into chipreg.bltcon0 of type CHIPREG]
  48.  
  49.  &
  50.  
  51.  move.w    (GLOBAL_con0_w,a4),(CHIPREG_bltcon0_w,a1)
  52.  
  53.  [Store con0 of type WORD, into chipreg.bltcon0 of type WORD]
  54.  
  55.  here I just happen to know WORD is 2 byte.. but so what.
  56.  
  57.  This programming logic enable people to corectly declar and use there 
  58.  variable.
  59.  
  60.  This is the last I have to say about it. I repeated myself too much already
  61.  
  62.  Stephan
  63.